package com.yuexia.yxim.server.processer;

import com.yuexia.yxim.server.server.ServerSession;
import io.netty.channel.Channel;


/**
 * AbstractServerProcesser
 *
 * @author wjp
 * @date 2020/6/3
 */
public abstract class AbstractServerProcesser implements ServerProcesser{

    protected String getkey(Channel ch) {
        return ch.attr(ServerSession.KEY_USER_ID).get();
    }

    protected void chaeckAuth(Channel channel) throws Exception{
        if (null == getkey(channel)) {
            throw new Exception("此用户，没有登录成功");
        }
    }

}
